import React from 'react';
import ReactDOM from 'react-dom';
import {HashRouter as Router,Switch,Route,Link,Redirect} from 'react-router-dom';

import { LocaleProvider } from 'antd';
import zh_CN from 'antd/lib/locale-provider/zh_CN';
import 'moment/locale/zh-cn';
//页面
import Home from 'page/home/index.jsx';
import Login from 'page/login/index.jsx';
import UserBase from 'page/user/userbase/index.jsx';
import UserLink from 'page/user/userlink/index.jsx';
import UserNick from 'page/user/usernick/index.jsx';
import BindUser from 'page/user/binduser/index.jsx';
import UserRegister from 'page/register/index.jsx';
import Layout from 'page/layout/index.jsx';
import UpdateHeadImg from 'page/updateheadimg/index.jsx';
import Updatepsw from 'page/safty/updatepsw/index.jsx';
import UpdatePhone from 'page/safty/updatephone/index.jsx';
import UpdateEmail from 'page/safty/updateemail/index.jsx';
import UpdateSecurity from 'page/safty/security/index.jsx';
import RecordSafty from 'page/safty/recordsafty/index.jsx';
import AccountAppeal from 'page/accountappeal/index.jsx';
import ForgetPSW from 'page/forgetpsw/index.jsx';
import ErrorPage from 'page/error/index.jsx';


class App extends React.Component{ 
	render(){
		return(
			<Router>
				<Switch>
					<Route  path="/login" component={Login} />
					<Route  path="/register" component={UserRegister} />
					<Route  path="/accountappeal" component={AccountAppeal} />
					<Route  path="/forgetpsw" component={ForgetPSW} />
					<Route  path="/" render={(props)=>(
						<Layout>
							<Switch>
									<Route exact path="/" component={Home} />
									<Route  path="/user-base" component={UserBase} />
									<Route  path="/user-link" component={UserLink} />
									<Route  path="/user-nick" component={UserNick} />
									<Route  path="/binduser" component={BindUser} />
									<Route  path="/update-head-img" component={UpdateHeadImg} />
									<Route  path="/updatepsw" component={Updatepsw} />
									<Route  path="/updatephone" component={UpdatePhone} />
									<Route  path="/updateemail" component={UpdateEmail} />
									<Route  path="/security" component={UpdateSecurity} />
									<Route  path="/recordsafty" component={RecordSafty} />
									<Route  component={ErrorPage} />
							</Switch>
						</Layout>
					)} />
				</Switch>
			</Router>
		);
	}
}
ReactDOM.render(
	<LocaleProvider locale={zh_CN}><App /></LocaleProvider>,  
  document.getElementById('app')
);